package com.alibaba.citrus.cr.sales.plan.api.salesplan;

import java.math.BigDecimal;
import java.util.List;

import com.alibaba.citrus.cr.sales.plan.dto.api.request.PageQueryPlanLineRequest;
import com.alibaba.citrus.cr.sales.plan.dto.api.request.SalesPlanSubTotalRequest;
import com.alibaba.citrus.cr.sales.plan.dto.api.response.SalesPlanSubTotalResponse;
import com.alibaba.citrus.cr.sales.plan.sdo.SalesPlanLineSDO;
import com.alibaba.cz.base.tool.page.PageResult;
import com.alibaba.lattice2.epoch.meshflow.model.annotation.MeshFlowService;
import com.alibaba.lattice2.epoch.sdk.model.Result;

/**
 * @author yuhailin
 * @description:
 * @date 2021-09-06 19:10
 */
@MeshFlowService(apps = {"bc_order"}, name = "SalesPlanLineQueryService")
public interface SalesPlanLineQueryService {

    /**
     * 分页查询月度计划明细
     *
     * @param pageQuerySalePlanRequest
     * @return
     */
    Result<PageResult<List<SalesPlanLineSDO>>> pageQuerySalesPlanLineList(PageQueryPlanLineRequest pageQuerySalePlanRequest);

    /**
     * 月度计划明细小计：
     *
     * @param salesPlanSubTotalRequest
     * @return
     */
    Result<SalesPlanSubTotalResponse> subTotalSalesPlanLine(SalesPlanSubTotalRequest salesPlanSubTotalRequest);

    /**
     * 月度计划明细完成度占比
     * @param salesPlanSubTotalRequest
     * @return
     */
    Result<BigDecimal> queryCompletePercent(SalesPlanSubTotalRequest salesPlanSubTotalRequest);

    /**
     * 根据条件查询明细(用于新增明细已维护地址置灰)
     * @param salesPlanSubTotalRequest
     * @return
     */
    Result<List<String>> querySalesPlanLineByCustomerAddress(SalesPlanSubTotalRequest salesPlanSubTotalRequest);

    /**
     * 根据条件查询明细(用于新增明细已维护货品置灰)
     * @param salesPlanSubTotalRequest
     * @return
     */
    Result<List<String>> querySalesPlanLineByScItem(SalesPlanSubTotalRequest salesPlanSubTotalRequest);

    /**
     * 分页查询月度计划明细 无权限判断，简单查db
     *
     * @param pageQuerySalePlanRequest
     * @return
     */
    Result<PageResult<List<SalesPlanLineSDO>>> pageQuerySalesPlanLineListFromDb(PageQueryPlanLineRequest pageQuerySalePlanRequest);
}
